<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>    
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>
    <style>
        .box{
            display: flex;
            width: 200px;
            height: 100px;
            border: 1px solid;
            align-items: center;
            justify-content: center;
            margin: 10px;
        }
    </style>
</head>
<!-- v-show 本质是通过css 设置display：none -->
<!-- v-if 通过判断条件控制元素创建和移除（条件渲染） -->
<!-- v-show 频繁切换 -->
<body>
    <div id="app">
        <div class="box" v-show="flag">v-show</div>
        <div class="box" v-if="flag">v-if</div>
    </div>
</body>
<script>
   const app=new Vue({
    el:'#app',
    data:{
     flag:true,
    }
   })
</script>
</html>